package com.mdl.mall.service.impl;

import com.mdl.mall.entity.TCustomerInfo;
import com.mdl.mall.mapper.TCustomerInfoMapper;
import com.mdl.mall.service.TCustomerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Desc
 * @Author madengling
 * @Time 2020/10/16 13:32
 */
@Service
public class TCustomerInfoImpl implements TCustomerInfoService {
    @Autowired
    private TCustomerInfoMapper customerInfoMapper;

    @Override
    public List<TCustomerInfo> getTCustomerInfo(){
        List<TCustomerInfo> list = customerInfoMapper.getTCustomer();
        return list;
    }

    @Override
    public void addTCustomerInfo(TCustomerInfo tCustomerInfo) {
        customerInfoMapper.addTCustomer(tCustomerInfo);
    }

    @Override
    public boolean checkQrIsNull(Integer qrCode) {
        int num = 0;
        if(qrCode!=null){
            num = customerInfoMapper.checkQrIsNull(qrCode);
        }
        if(num>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public TCustomerInfo getTCustomerInfoById(Integer id) {
        return customerInfoMapper.getTCustomerById(id);
    }
}
